<template>
	<view>
		<view class="my-settle-1">

			<label class="radio" @click="changeAll">
				<radio :checked="isFulCheck" color="#c00000" /><text>全选</text>
			</label>
			<view class="heji">
				合计：<text>￥{{checkedGoodsAmount}}</text>
			</view>
			<view class="jiesuan">
				结算（{{checkedCount}}）
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	export default {
		name: "jiesuan",
		data() {
			return {

			};
		},
		computed: {
			...mapGetters('cart_m', ['checkedCount','total','checkedGoodsAmount']),
			isFulCheck() {
				return this.total == this.checkedCount
			}
		},
		methods: {
			...mapMutations('cart_m', ['updateAllGoodsState']),
			changeAll() {
				this.updateAllGoodsState(!this.isFulCheck)
			}
		},
	}
</script>

<style lang="scss">
	.my-settle-1 {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 50px;
		background-color: white;
		display: flex;
		align-items: center;
		justify-content: space-between;
		z-index: 100;

		.radio {
			margin-left: 6px;
		}
	}
</style>
